import logging
import redis

class Config(object):
    """"工程配置信息"""
    SECRET_KEY = "FJDKGHKDFFSJDFFSJKDHKHFSFHJSDFSDF55FS54D48786D465SD84F6546-*-/"

    DEBUG =True

    #数据库的配置信息
    SQLALCHEMY_DATABASE_URI = 'mysql://root:mysql@127.0.0.1:3306/news_web'
    SQLALCHEMY_TRACK_MODIFICATIONS= False

    #redis配置
    REDIS_HOST = '127.0.0.1'
    REDIS_PORT = 6379

    #session配置
    SESSION_TYPE = "redis"  #指定session保存到redis中
    SESSION_USE_SIGNER = True  #让cookie中的session_id 被加密签名处理
    SESSION_REDIS =redis.StrictRedis(host=REDIS_HOST,port=REDIS_PORT) #使用redis实例
    PERMANENT_SESSION_LIFETIME = 86400

    LOG_LEVEL = logging.DEBUG

class DevelopementConfig(Config):
    DEBUG = True


class ProductionConfig(Config):
    LOG_LEVEL = logging.ERROR



config = {
    "development": DevelopementConfig,
    "production": ProductionConfig
}



